package com.andong.controller;

import com.andong.annotations.AccessControl;
import com.andong.domain.dto.AdminDTO;
import com.andong.domain.dto.UpdatePasswordDTO;
import com.andong.domain.pojo.PageResult;
import com.andong.domain.pojo.Result;
import com.andong.service.AdminService;
import com.andong.service.StatisticsService;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.time.LocalDate;

import static com.andong.utils.SystemConstant.*;

/**
 * 管理员信息表(Admin)表控制层
 *
 * @author makejava
 * @since 2024-01-03 18:43:52
 */
@RestController
@RequestMapping("/statistics")
public class StatisticsController {
    @Resource
    private StatisticsService statisticsService;

    @GetMapping("/studentType")
    @AccessControl(roles = {ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getStudentByType() {
        return statisticsService.getStudentByType();
    }
    @GetMapping("/studentGender")
    @AccessControl(roles = {COACH, ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getStudentByGender() {
        return statisticsService.getStudentByGender();
    }

    @GetMapping("/coachType")
    @AccessControl(roles = {ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getCoachByType() {
        return statisticsService.getCoachByType();
    }
    @GetMapping("/coachGender")
    @AccessControl(roles = {ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getCoachByGender() {
        return statisticsService.getCoachByGender();
    }

    @GetMapping("/count")
    @AccessControl(roles = {ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getCount() {
        return statisticsService.getCount();
    }

    @GetMapping("/stage")
    @AccessControl(roles = {ADMIN, SUPER_ADMIN}, permission = "数据统计")
    public Result getStage() {
        return statisticsService.getStage();
    }
}

